<?php
class Model_Products {
	function Model_Products() {
		  $this->_tbProducts =& FLEA::getSingleton('Model_DB_Products');
	}
	function getProduct($pid,$withAssoc=true) {
		$link =& $this->_tbProducts->getLink('pclass');
		$link->enabled = $withAssoc;
		return $this->_tbProducts->find((int)$pid);
	}
	function addProduct($product) {
		$pid = $this->_tbProducts->create($product);
		return $pid;
	}
	function & getTable() {
		return $this->_tbProducts;
	}
}
?>